home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kopete / kopetemessageevent.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-09-10  |  3.2 KB  |  130 lines

  1. /*
  2.     kopetemessageevent.h - Kopete Message Event
  3.  
  4.     Copyright (c) 2003 by Olivier Goffart <ogoffart @ kde.org>
  5.     Copyright (c) 2002 by Duncan Mac-Vicar Prett <duncan@kde.org>
  6.     Copyright (c) 2002 by Hendrik vom Lehn <hvl@linux-4-ever.de>
  7.     Copyright (c) 2004 by Richard Smith <richard@metafoo.co.uk>
  8.  
  9.     Kopete    (c) 2002 by the Kopete developers  <kopete-devel@kde.org>
  10.  
  11.     *************************************************************************
  12.     *                                                                       *
  13.     * This library is free software; you can redistribute it and/or         *
  14.     * modify it under the terms of the GNU Lesser General Public            *
  15.     * License as published by the Free Software Foundation; either          *
  16.     * version 2 of the License, or (at your option) any later version.      *
  17.     *                                                                       *
  18.     *************************************************************************
  19. */
  20.  
  21. #ifndef KOPETEMESSAGEEVENT_H
  22. #define KOPETEMESSAGEEVENT_H
  23.  
  24. #include <qobject.h>
  25.  
  26. #include "kopetemessage.h"
  27.  
  28. #include "kopete_export.h"
  29.  
  30. namespace Kopete
  31. {
  32.  
  33. /**
  34.  * @author Olivier Goffart <ogoffart @ kde.org>
  35.  * @author Richard Smith   <richard@metafoo.co.uk>
  36.  *
  37.  * Kopete::MessageEvent is used when a new messages arrives, it is
  38.  * caught by the UI. It contains just informations about
  39.  * the message, and a signal when it is terminated (i.e.
  40.  * the message is read
  41.  **/
  42. class KOPETE_EXPORT MessageEvent : public QObject
  43. {
  44.     Q_OBJECT
  45.  
  46. public:
  47.     MessageEvent(const Kopete::Message& , QObject* parent=0L, const char *name=0L);
  48.     ~MessageEvent();
  49.  
  50.     /**
  51.      * @return A copy of the message
  52.      */
  53.     Kopete::Message message();
  54.     
  55.     /**
  56.      * Sets the message contained in this event.
  57.      * @param message The new value for the message
  58.      */
  59.     void setMessage( const Kopete::Message &message );
  60.  
  61.     /**
  62.      * The state of the event.
  63.      * - @c Nothing means that the event has not been accepted or ignored
  64.      * - @c Applied if the event has been applied
  65.      * - @c Ignored if the event has been ignored
  66.      */
  67.     enum EventState { Nothing , Applied , Ignored };
  68.  
  69.     EventState state();
  70.  
  71. public slots:
  72.     /**
  73.      * @deprecated Use accept() instead to continue the processing of this event once the caller has moved to using MessageHandlers
  74.      * 
  75.      * execute the event
  76.      */
  77.     void apply();
  78.     
  79.     /**
  80.      * @deprecated Use discard() instead to destroy this event once the caller has moved to using MessageHandlers
  81.      * 
  82.      * ignore the event
  83.      */
  84.     void ignore();
  85.     
  86.     /**
  87.      * @brief Passes the event to the next handler
  88.      * 
  89.      * Call this when you've finished processing this event
  90.      */
  91.     void accept();
  92.     
  93.     /**
  94.      * @brief Discards the event
  95.      *
  96.      * If this event should not be processed any further, this function
  97.      * should be called to discard it.
  98.      */
  99.     void discard();
  100.     
  101. signals:
  102.     /**
  103.      * The event has been processed
  104.      */
  105.     void done(Kopete::MessageEvent *);
  106.     
  107.     /**
  108.      * The event has been discarded.
  109.      * @param event The event sending the signal.
  110.      */
  111.     void discarded(Kopete::MessageEvent *event);
  112.     
  113.     /**
  114.      * The event has been accepted by its current handler.
  115.      * @param event The event sending the signal.
  116.      */
  117.     void accepted(Kopete::MessageEvent *event);
  118.  
  119. private:
  120.     class Private;
  121.     Private *d;
  122. };
  123.  
  124. }
  125.  
  126. #endif
  127.  
  128. // vim: set noet ts=4 sts=4 sw=4:
  129.  
  130.